﻿/*
* SceneBuilder.cpp
*
* 场景创建器
*
* create date: 2014.4.10
* create by: leo
*
*/

#include "SceneBuilder.h"

#include "SplashScene.h"
#include "BattleScene.h"

typedef CBaseScene* (*SceneCreater)();

typedef struct SceneDefines
{
	int type;
	SceneCreater creater;
} SceneDefines;

SceneDefines AllScenes[] = {
	{SPLASH_SCENE, CSplashScene::create},
	{BATTLE_SCENE, CBattleScene::create},
};

//

CBaseScene* CSceneBuilder::CreateScene(int scene)
{
	CBaseScene* newScene = NULL;

	newScene = (*AllScenes[scene].creater)();

	return newScene;
}
